<?php
/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * @Date: 2021-07-27 14:55:18
 * @LastEditors: Sam
 * @LastEditTime: 2022-01-26 17:12:41
 */

namespace app\admin\model;
use think\Model;


/**
 * 轮播 model
 * Class User
 * @package app\admin\model\user
 */
class GoodsComment extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'goods_comment';

    public function getCreateTimeAttr($value){
        return date('Y-m-d H:i',$value);
    }
    
    public function getImagesAttr($value){
        return $value ? explode(',',$value) : [];
    }
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;



    public function goods(){
        return $this->belongsTo(Goods::class,'goods_id')->bind(['store_name','image']);
    }
}